import User from './services/user.js';
App({
  globalData: {
    userInfo: null
  },
  async onLaunch() {
    let token = wx.getStorageSync('token');
    console.log("token",token)
    if(!token){
        let isSuccess = await User.login()
        if(!isSuccess){
            console.log('登录失败');
        }
    }else{
        let res = await User.checkToken()
        if(res){
            let isSuccess =await User.login()
            if(!isSuccess){
                console.log('重试登录失败');
            }
        }
    }
  }
})
